#ifndef __TESTREDIS_HPP__
#define __TESTREDIS_HPP__
#include <string.h>
#include <stdio.h> 
#include <vector>

#include <hiredis/hiredis.h> 
#include <iostream> 
#include <string>

using std::cout; 
using std::endl;
using std::vector;
using std::string; 

class MyRedis 
{
public:
    MyRedis() {}
    ~MyRedis() 
    { 
        _pConnect = nullptr;
        _pReply = nullptr; 
    }

    bool connect(string host, int port);
    string getValues(string key,string );
    bool getKeys(string key,vector<string> & );
    void set(string key1,string key2, string value);
    void setOutTime(string key1);
private:
    redisContext* _pConnect;//建立连接 
    redisReply* _pReply; //发送命令
};
#endif

